/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#include "MkGbStreamSource.h"
#include "MkRtp/MkRtp.h"

CMkGbStreamSource::CMkGbStreamSource(CMkRtp* pRtp, const Uint32& Ssrc, const MkGbStreamSourceStopCallback& StopCb)
    : CMkPsStreamSource()
    , m_pRtp(pRtp)
    , m_Ssrc(Ssrc)
    , m_StopCb(StopCb)
{

}

Uint32 CMkGbStreamSource::StopMediaSource()
{
    if (m_StopCb) {
        m_StopCb();
    }
    m_pRtp->DeleteRemoter(m_Ssrc);
    delete this;
    return NoneError;
}

CMkGbStreamSource::~CMkGbStreamSource()
{

}